package config

import (
	"encoding/json"
	"github.com/chicken-team-outside/chicken_transmission/model"
)
import _ "embed"

func Init() error {
	initFunc := []func() error{
		initLogLevel,
		initHttpSetting,
		initNetDisk,
		initLocalDiskDriver,
		initRpcServerSetting,
		initDownloadSetting,
	}
	for _, f := range initFunc {
		if err := f(); err != nil {
			return err
		}
	}
	return nil
}

type DriverInfo struct {
	Vendor         model.Vendor    `json:"vendor"`
	UserName       string          `json:"user_name"`
	ConnectionInfo json.RawMessage `json:"connection_info"`
}
